//
// Created by guanyicheng on 2021/11/1.
//

#include "../../common.h"

class Solution {
public:
    int distributeCandies(vector<int> &candyType) {
        auto _set = unordered_set<int>();
        for (auto i: candyType) {
            _set.emplace(i);
        }
        return candyType.size() / 2 < _set.size() ? candyType.size() / 2 : _set.size();
    }
};

int main() {
    auto v = vector<int>{1, 1, 2, 3};
    cout << Solution().distributeCandies(v) << endl;
}